package com.yc.video.constants;

import org.springframework.util.ResourceUtils;

import java.io.File;
import java.io.FileNotFoundException;

/**
 * 全局变量定义
 * yc
 * 2020-1-19 18:43:43
 */
public final class Globals {
	/**
	 * 测试
	 */
	public static Long testGlobals = 0L;

	/**
	 *	构建上传目标路径，找到项目的target的classes目录
	 */
	public static File targetClassPath = new File("");
	static {
		try {
			targetClassPath= new File(ResourceUtils.getURL("classpath:").getPath());
			if (!targetClassPath.exists()) {
				targetClassPath = new File("");//如果是jar包,则会创建项目运行的同级别目录
			}
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}

	}
}
